import {exec} from 'child_process';

const startEXE = (exePath: string) => {
    return new Promise((resolve, reject) => {
        exec(`"${exePath}"`, (error: any, stdout: any, stderr: any) => {

            if (error) {
                resolve(false);
            } else if (stderr) {
                resolve(false);
            } else {
                resolve(true);
            }
            // 停止命令
            exec('taskkill /f /im "*.exe"');
        });
    });
};


export default startEXE;